using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;

using System.Collections.Generic;

/// <summary>
/// Summary description for DataBindSQL
/// </summary>
public class DataBindSQL
{
    public DataBindSQL()
    {
        //
        // TODO: Add constructor logic here
        //
    }
    //Ham thuc thi tra ve database

    public DataTable TableThongKe()
    {
        DataTable dtb = new DataTable();
        // Khai bao chuoi ket noi
        string ConnectionString =
        @"Server =.;Initial Catalog=vit_khcn;User ID=sa;Password=vittelecom!@#";
        SqlConnection Conn = new SqlConnection(ConnectionString);
        try
        {
            // Mo ket noi
            Conn.Open();
            DataSet ds = new DataSet();
            SqlCommand cmdUpd = new SqlCommand("spThongKe_Edit", Conn);
            cmdUpd.CommandType = CommandType.StoredProcedure;
            SqlDataAdapter da = new SqlDataAdapter(cmdUpd);
            // Do du lieu vao DataSet
            da.Fill(ds);
            dtb = ds.Tables[0];
        }

        catch { }
        finally
        {
            if (Conn.State == ConnectionState.Open)
                Conn.Close();
            Conn.Dispose();
        }
        return dtb;
    }

}
